package roleenum

type roleStatus int
type RoleType int

const (
	Enable  roleStatus = 1
	Disable roleStatus = 2
)

func NewStatus(code int) roleStatus {
	return roleStatus(code)

}

var ListStatusMap = map[roleStatus]string{
	Enable:  "启用",
	Disable: "禁用",
}

func (p roleStatus) StringStatus() string {
	if v, ok := ListStatusMap[p]; ok {
		return v
	}
	return "空"
}

// 角色分类
const (
	AbilityRole RoleType = 1
	CmsDataRole RoleType = 2
)

func NewType(code int) RoleType {
	return RoleType(code)

}

var ListTypeMap = map[RoleType]string{
	CmsDataRole: "数据权限",
	AbilityRole: "功能权限",
}

func (p RoleType) StringType() string {
	if v, ok := ListTypeMap[p]; ok {
		return v
	}
	return "空"
}
